You're kind of gaming the system here, but after a quick look, I can see
that it should work. The actual raw data is a three followed by three
(8-byte) numbers, yes, RADIX-100.

Record 0 is the Diskname in the string field, a zero in the first numeric
position, the number of sectors on the disk in the second, and the number of
free sectors in the third.

For all other records, the string field is the filename, the first number is
the type, the second is the file size in sectors (including the FDR, so an
empty file is 1), and the last is the record length (0 for programs).

A string is stored as a length byte, followed by that many bytes of data. So
"HELLO" is stored as >05,'H','E','L','L','O'
The radix 100 numbers are stored as a length byte (always 8), followed by 8
bytes of RADIX 100 data. The TI Disk controller cheats a little, and its
routine can only handle numbers from -9999 to 9999 - only the first three
bytes will ever be filled in, the rest are zero. (Since they both have a
similar format, I guess that's why your trick works!)

Negative numbers actually affect the first TWO bytes, but you can't ignore
the first byte anyway, since it contains the exponent. My translation of the
TI disk controller code says it will always be either >41 (65) if the number
is greater than or equal to 100, or >40 (64) if less.

In this limited implementation, if the number is 100 or larger, then the
second byte is the number of hundreds (from 1 - 99), and the third byte is
the number of units (0-99). Otherwise, the second byte is the number of
units (0-99), and the third byte is zero.

Bytes 4-8 are always zero from the TI disk controller.

The way a negative value works, though I don't think you'll see one, is that
the first two bytes are inverted. In this limited case, that means you'd see
>BE or >BF instead of >41 or >40 in the first byte, and would have to
bitwise invert the second byte to get the correct value. The rest of the
number is unaffected.


  
100 CALL CLEAR
110 DIM TYPE$(5)
120 TYPE$(1)="D/F"
130 TYPE$(2)="D/V"
140 TYPE$(3)="I/F"
150 TYPE$(4)="I/V"
160 TYPE$(5)="PRG"
164 INPUT D$
165 REM  THIS OPENS AS IF/0 - WHICH BECOMES IF/38
170 OPEN #1:D$,INPUT ,RELATIVE,INTERNAL
175 REM  'ZERO' IS ALWAYS 0
180 INPUT #1:DISKNAME$,ZERO,DISKSECTORS,FREESECTORS
190 DISPLAY "DISKNAME= ";DISKNAME$:"AVAILABLE= ";FREESECTORS;" USED=";DISKSECTORS-FREESECTORS
200 DISPLAY :"FILENAME  SIZE    TYPE    P":"---------- ---- ---------- -";
205 REM  A FILETYPE OF 0 ALSO MEANS END OF DIRECTORY
207 REM  FILETYPE IS NEGATIVE FOR A PROTECTED FILE
210 INPUT #1:FILENAME$,FILETYPE,FILESECTORS,RECORDLENGTH
220 IF LEN(FILENAME$)=0 THEN 300
230 DISPLAY :FILENAME$;TAB(12);FILESECTORS;TAB(17);TYPE$(ABS(FILETYPE));
235 REM  PROGRAM FILES DON'T HAVE A RECORD LENGTH
240 IF ABS(FILETYPE)=5 THEN 270
250 B$=" "&STR$(RECORDLENGTH)
260 DISPLAY SEG$(B$,LEN(B$)-2,3);
270 IF FILETYPE>0 THEN 210
280 DISPLAY TAB(28);"Y";
290 GOTO 210
300 CLOSE #1
